/*
 * TipoCambioView.java
 *
 * Created on 10/11/2009, 09:59:05 PM
 */

package solucionessgh.TipoCambio;

import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import solucionessgh.Moneda.MonedaController;
import solucionessgh.Moneda.MonedaModel;
import solucionessgh.Util.ComboInfo;
import solucionessgh.Util.DatePickerSimple;
import solucionessgh.Util.Reporte;

/**
 *
 * @author roderick
 */
public class TipoCambioView extends javax.swing.JDialog {

    private TipoCambioModel model;
    private int id;
    private int action;//1=nuevo,2=modificar o eliminar
    
    /** Creates new form TipoCambioView */
    public TipoCambioView(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();

        model = new TipoCambioModel();
        setResizable(false);
        txt_tcbfec.setEditable(false);
        cbo_moncod.setEditable(false);
        txt_tcbcom.setEditable(false);
        txt_tcbven.setEditable(false);

        btn_nuevo.setEnabled(true);
        btn_editar.setEnabled(false);
        btn_grabar.setEnabled(false);
        btn_eliminar.setEnabled(false);
        btn_cancelar.setEnabled(false);

        MonedaModel model_moneda = new MonedaModel();
        ResultSet rs = model_moneda.read();
        try {
            while ( rs.next()){
                this.cbo_moncod.addItem(new ComboInfo(rs.getInt("moncod"),rs.getString("mondesc")));
            }
        }catch (SQLException ex) {
            System.err.println(ex.toString());
        }

        java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
        java.awt.Dimension screenSize = tk.getScreenSize();
        int screenHeight = screenSize.height;
        int screenWidth = screenSize.width;
        setLocation(screenWidth / 4, screenHeight / 4);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btn_eliminar = new javax.swing.JButton();
        btn_cancelar = new javax.swing.JButton();
        btn_salir = new javax.swing.JButton();
        btn_nuevo = new javax.swing.JButton();
        btn_editar = new javax.swing.JButton();
        btn_grabar = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        cbo_moncod = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        btn_fecha = new javax.swing.JButton();
        txt_tcbfec = new javax.swing.JTextField();
        txt_tcbcom = new javax.swing.JTextField();
        txt_tcbven = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        btn_print = new javax.swing.JButton();
        btn_buscar = new javax.swing.JButton();
        btn_moneda = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Tipo de Cambio");

        btn_eliminar.setFont(new java.awt.Font("Tahoma", 0, 12));
        btn_eliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/solucionessgh/resources/delete.png"))); // NOI18N
        btn_eliminar.setText("Eliminar");

        btn_cancelar.setFont(new java.awt.Font("Tahoma", 0, 12));
        btn_cancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/solucionessgh/resources/close.png"))); // NOI18N
        btn_cancelar.setText("Cancelar");
        btn_cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_cancelarActionPerformed(evt);
            }
        });

        btn_salir.setFont(new java.awt.Font("Tahoma", 0, 12));
        btn_salir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/solucionessgh/resources/exit.png"))); // NOI18N
        btn_salir.setText("Salir");
        btn_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_salirActionPerformed(evt);
            }
        });

        btn_nuevo.setFont(new java.awt.Font("Tahoma", 0, 12));
        btn_nuevo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/solucionessgh/resources/new.png"))); // NOI18N
        btn_nuevo.setText("Nuevo");
        btn_nuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_nuevoActionPerformed(evt);
            }
        });

        btn_editar.setFont(new java.awt.Font("Tahoma", 0, 12));
        btn_editar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/solucionessgh/resources/edit.png"))); // NOI18N
        btn_editar.setText("Editar");
        btn_editar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_editarActionPerformed(evt);
            }
        });

        btn_grabar.setFont(new java.awt.Font("Tahoma", 0, 12));
        btn_grabar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/solucionessgh/resources/save.png"))); // NOI18N
        btn_grabar.setText("Grabar");
        btn_grabar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_grabarActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(" Datos Tipo de Cambio"));

        jLabel3.setText("Fecha :");

        btn_fecha.setText("...");
        btn_fecha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_fechaActionPerformed(evt);
            }
        });

        txt_tcbfec.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txt_tcbfecFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                txt_tcbfecFocusLost(evt);
            }
        });

        txt_tcbcom.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txt_tcbcomFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                txt_tcbcomFocusLost(evt);
            }
        });

        txt_tcbven.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txt_tcbvenActionPerformed(evt);
            }
        });
        txt_tcbven.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txt_tcbvenFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                txt_tcbvenFocusLost(evt);
            }
        });

        jLabel4.setText("Compra :");

        jLabel5.setText("Venta :");

        jLabel6.setText("Moneda :");

        btn_print.setIcon(new javax.swing.ImageIcon(getClass().getResource("/solucionessgh/resources/print.png"))); // NOI18N
        btn_print.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_printActionPerformed(evt);
            }
        });

        btn_buscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/solucionessgh/resources/find.png"))); // NOI18N
        btn_buscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_buscarActionPerformed(evt);
            }
        });

        btn_moneda.setText("...");
        btn_moneda.setToolTipText("Moneda");
        btn_moneda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_monedaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txt_tcbven, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
                            .addComponent(txt_tcbcom, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
                            .addComponent(cbo_moncod, 0, 183, Short.MAX_VALUE)
                            .addComponent(txt_tcbfec, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btn_moneda)
                            .addComponent(btn_fecha)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(btn_buscar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btn_print)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btn_print)
                    .addComponent(btn_buscar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(txt_tcbfec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btn_fecha))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbo_moncod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(btn_moneda))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_tcbcom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_tcbven, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btn_salir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btn_cancelar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btn_eliminar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btn_grabar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btn_editar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btn_nuevo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btn_nuevo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btn_editar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btn_grabar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btn_eliminar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btn_cancelar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btn_salir))
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btn_cancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_cancelarActionPerformed
        txt_tcbfec.setText("");
        cbo_moncod.setSelectedIndex(0);
        txt_tcbcom.setText("");
        txt_tcbven.setText("");

        btn_nuevo.setEnabled(true);
        btn_editar.setEnabled(false);
        btn_grabar.setEnabled(false);
        btn_eliminar.setEnabled(false);
        btn_cancelar.setEnabled(false);
}//GEN-LAST:event_btn_cancelarActionPerformed

    private void btn_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_salirActionPerformed
        setVisible(true);
        dispose();
}//GEN-LAST:event_btn_salirActionPerformed

    private void btn_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_buscarActionPerformed
        BuscarView dialog = new BuscarView(new javax.swing.JFrame(), true, model);
        dialog.setVisible(true);
        if(dialog.getId()==0)
            return;

        ResultSet rs = this.model.finder(dialog.getId());
        try {
            if(rs.next()){
                id = rs.getInt("tcid");
                txt_tcbfec.setText(rs.getString("tcbfec"));

                int num = cbo_moncod.getComponentCount();
                for(int i = 0;i<num+2;i++){
                    ComboInfo obj = (ComboInfo) cbo_moncod.getItemAt(i);
                    if(Integer.parseInt(rs.getString("moncod").toString()) == obj.getId()){
                        cbo_moncod.setSelectedIndex(i);
                        break;
                    }
                }
                txt_tcbcom.setText(rs.getString("tcbcom"));
                txt_tcbven.setText(rs.getString("tcbven"));
            }
        }catch (SQLException ex) {
            System.err.println(ex.toString());
        }

        btn_nuevo.setEnabled(false);
        btn_editar.setEnabled(true);
        btn_grabar.setEnabled(false);
        btn_eliminar.setEnabled(false);
        btn_cancelar.setEnabled(false);
    }//GEN-LAST:event_btn_buscarActionPerformed

    private void btn_printActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_printActionPerformed
        Reporte rep = new Reporte("/solucionessgh/TipoCambio/ReporteTipoCambio.jasper");
        try {
            rep.setVisible();
        } catch (ClassNotFoundException ex) {
            System.out.println(ex.toString());
        }
}//GEN-LAST:event_btn_printActionPerformed

    private void btn_nuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_nuevoActionPerformed
        txt_tcbfec.setEditable(true);
        cbo_moncod.setEditable(true);
        txt_tcbcom.setEditable(true);
        txt_tcbven.setEditable(true);

        btn_nuevo.setEnabled(false);
        btn_editar.setEnabled(false);
        btn_grabar.setEnabled(true);
        btn_eliminar.setEnabled(false);
        btn_cancelar.setEnabled(true);

        id=0;
        action=1;
}//GEN-LAST:event_btn_nuevoActionPerformed

    private void btn_editarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_editarActionPerformed
        action=2;

        btn_nuevo.setEnabled(false);
        btn_editar.setEnabled(false);
        btn_grabar.setEnabled(true);
        btn_eliminar.setEnabled(true);
        btn_cancelar.setEnabled(true);

        txt_tcbfec.setEditable(true);
        cbo_moncod.setEditable(true);
        txt_tcbcom.setEditable(true);
        txt_tcbven.setEditable(true);
}//GEN-LAST:event_btn_editarActionPerformed

    private void btn_grabarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_grabarActionPerformed
        Date date = new Date(0000-00-00);
        ComboInfo obj = (ComboInfo) this.cbo_moncod.getSelectedItem();
       
        model.setTcbfec(date.valueOf(txt_tcbfec.getText()));        
        model.setMoncod(obj.getId());
        model.setTcbcom(Double.parseDouble(txt_tcbcom.getText()));
        model.setTcbven(Double.parseDouble(txt_tcbven.getText()));
        

        model.setId(id);

        if(this.action==1){//grabar
            if(model.create()){
                JOptionPane.showMessageDialog(null,
                        "Grabacion OK",
                        "Moneda",
                        JOptionPane.INFORMATION_MESSAGE);
                txt_tcbfec.setText("");
                cbo_moncod.setSelectedIndex(0);
                txt_tcbcom.setText("");
                txt_tcbven.setText("");

                btn_nuevo.setEnabled(true);
                btn_editar.setEnabled(false);
                btn_grabar.setEnabled(false);
                btn_eliminar.setEnabled(false);
                btn_cancelar.setEnabled(false);
                return;
            }
        }
        if(this.action==2){//modificar
            int n = JOptionPane.showConfirmDialog(
                    null,
                    "Desea Mofiicar ",
                    "Modificar",
                    JOptionPane.YES_NO_OPTION);
            if (n == JOptionPane.YES_OPTION) {
                if(model.update()){
                    if (n == JOptionPane.YES_OPTION) {
                        JOptionPane.showMessageDialog(null,
                                "Modificacion OK",
                                "Moneda",
                                JOptionPane.INFORMATION_MESSAGE);
                        txt_tcbfec.setText("");
                        cbo_moncod.setSelectedIndex(0);
                        txt_tcbcom.setText("");
                        txt_tcbven.setText("");

                        btn_nuevo.setEnabled(true);
                        btn_editar.setEnabled(false);
                        btn_grabar.setEnabled(false);
                        btn_eliminar.setEnabled(false);
                        btn_cancelar.setEnabled(false);
                        return;
                    }
                }
            }
        }
    }//GEN-LAST:event_btn_grabarActionPerformed

    private void btn_fechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_fechaActionPerformed
        DatePickerSimple d = new DatePickerSimple(this);
        txt_tcbfec.setText(d.displayDatePicked());
}//GEN-LAST:event_btn_fechaActionPerformed

    private void txt_tcbvenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txt_tcbvenActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_txt_tcbvenActionPerformed

    private void btn_monedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_monedaActionPerformed
        MonedaController test = new MonedaController();
        test.renderView();

        MonedaModel model_moneda = new MonedaModel();
        cbo_moncod.removeAllItems();
        ResultSet rs = model_moneda.read();
        try {
            while ( rs.next()){
                this.cbo_moncod.addItem(new ComboInfo(rs.getInt("moncod"),rs.getString("mondesc")));
            }
        }catch (SQLException ex) {
            System.err.println(ex.toString());
        }
    }//GEN-LAST:event_btn_monedaActionPerformed

    private void txt_tcbfecFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txt_tcbfecFocusGained
        txt_tcbfec.setBackground(new java.awt.Color(255, 255, 204));
    }//GEN-LAST:event_txt_tcbfecFocusGained

    private void txt_tcbcomFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txt_tcbcomFocusGained
        txt_tcbcom.setBackground(new java.awt.Color(255, 255, 204));
    }//GEN-LAST:event_txt_tcbcomFocusGained

    private void txt_tcbvenFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txt_tcbvenFocusGained
        txt_tcbven.setBackground(new java.awt.Color(255, 255, 204));
    }//GEN-LAST:event_txt_tcbvenFocusGained

    private void txt_tcbfecFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txt_tcbfecFocusLost
        txt_tcbfec.setBackground(new java.awt.Color(255, 255, 255));
    }//GEN-LAST:event_txt_tcbfecFocusLost

    private void txt_tcbcomFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txt_tcbcomFocusLost
        txt_tcbcom.setBackground(new java.awt.Color(255, 255, 255));
    }//GEN-LAST:event_txt_tcbcomFocusLost

    private void txt_tcbvenFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txt_tcbvenFocusLost
        txt_tcbven.setBackground(new java.awt.Color(255, 255, 255));
    }//GEN-LAST:event_txt_tcbvenFocusLost


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_buscar;
    private javax.swing.JButton btn_cancelar;
    private javax.swing.JButton btn_editar;
    private javax.swing.JButton btn_eliminar;
    private javax.swing.JButton btn_fecha;
    private javax.swing.JButton btn_grabar;
    private javax.swing.JButton btn_moneda;
    private javax.swing.JButton btn_nuevo;
    private javax.swing.JButton btn_print;
    private javax.swing.JButton btn_salir;
    private javax.swing.JComboBox cbo_moncod;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField txt_tcbcom;
    private javax.swing.JTextField txt_tcbfec;
    private javax.swing.JTextField txt_tcbven;
    // End of variables declaration//GEN-END:variables

}
